-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
native upcasts #113
native upcasts #113
Conversation
Yes, something like that would work. |
1abb955
to
e0cfea1
Compare
e0cfea1
to
5047411
Compare
When built against nanobind (+ #116), this provides a modest speedup for the microbenchmark on M1:
|
I'm OK with option b) in both cases. I'm not sure option a) would work unmodified. You would likely need to call the casting function manually somewhere in there in order to get it to work, and this may be incrementally faster than option b). But a lot depends on exactly how much faster, and whether that justifies the extra effort (and generated code). At the same time, there's a small amount of speed-up here, and we're net deleting code: I'd call it a win regardless and would be happy to merge this, I think. |
This reverts commit bde3fee.
Option a) works in the way it is written above (possibly also due to making use of |
Thanks! |
Is this the approach you had in mind @inducer? (the actual code to create the upcasts would be added to gen_wrap.py)
1. Substitute for
make_new_upcast_wrapper
:Option a)
Option b)
wrap_basic_set.def("foreach_point", isl::set_foreach_point);
(I think the actual cast is handled by
impicitly_convertible
)2. Substitute for
make_existing_upcast_wrapper
:Option a)
Option b)
wrap_basic_set.def("union", isl::union_set_union);
Edit: I implemented option b) for both cases.